package com.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @author lifeng
 * @create 2022-11-28 10:51
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("cart")
public class Cart extends Model<Cart> {
    @TableId("id")
    private Integer id;//购物车id
    private Integer pId;//商品id
    private String username;//用户名
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;//创建时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;//修改时间
    private Integer count;//商品数量
    private Integer status;//购物车商品状态

    @TableField(exist = false)
    private Product product;//对应商品

    @TableField(exist = false)
    private Integer subtotal;//小计金额
}
